import request from '@/utils/request' 

// export function getList(params){
//     return request({
//         url: '/table/list',
//         method: 'get',
//         params
//     })
// }

export default {

    //1.讲师列表 （条件查询分页）
    getTeacherListPage(page,limit,teacherQuery){
        return request({
            // url: '/eduservice/edu-teacher/pageTeacherCondition/'+page+"/"+limit,
            url: `/eduservice/teacher/pageTeacherCondition/${page}/${limit}`,
            method: 'post',
            // params 条件对象
            data: teacherQuery
        })
    },
    //2.根据id删除讲师
    delTeacherById(id){
            return request({
                url: `/eduservice/teacher/deleteTeacherById/${id}`,
                method: 'delete'   
            })
    },

    //3,添加讲师
    addTeacher(teacher){
        return request({
            url: `/eduservice/edu-teacher/addTeacher`,
            method: 'post',
            //回显数据
            data: teacher
        })
    },

    //4.修改讲师
    updateTeacher(teacher){
        return request({
            url: `/eduservice/edu-teacher/updateTeacher`,
            method: 'post',
            //回显数据
            data: teacher
        })
    },

    //根据id查询 讲师
    getTeacherById(id){
        return request({
            url: `/eduservice/edu-teacher/getTeacher/${id}`,
            method: 'get',      
        })
    }

}